package com.manage.util;

import java.util.concurrent.atomic.AtomicLong;

public class IdUtil {

	public static AtomicLong atom = new AtomicLong(0);

	public static synchronized String getId() {
		if (atom.get() == 1000) {
			atom.set(0);
		}
		String s = String.format("%04d", atom.get());
		return System.currentTimeMillis() + "" + s;
	}

	public static void main(String[] args) {
		System.out.println(getId());
	}
}
